#region History

/* -------------------------------------------------------------------------------- 
 * Project Name: JobBoard Enterprise
 * Module: Jb.Web 
 * Name: Job.cs
 * Purpose: ViewModel class for Job
 *                   
 * Author: Md. Hassanur Rahman
 * Language: C# SDK Version 4.0
 * --------------------------------------------------------------------------------
 * Change History:
 * Version: 1.0    MHR  08/13/2012
 * Description: Initial Development
 * -------------------------------------------------------------------------------- */

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;


namespace Jb.Web.ViewModels
{
    [Serializable]
	public class JobViewModel : BaseViewModel
	{
        private List<GenericViewModel> _selectedEducations = new List<GenericViewModel>();
        private List<GenericViewModel> _selectedSkills = new List<GenericViewModel>();
        /// <summary>
		/// Gets or sets the ID
		/// </summary>
        public int ID { get; set;}
            
        [Required(ErrorMessage= "Please Enter a Job Title")]
        [StringLength(350, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Job Title")]
        [AllowHtml]
		public String Title	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Url")]
        [StringLength(350, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Url")] 
		public String Url	{ get; set; }
            
        [StringLength(2000, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Summary")]
        [AllowHtml]
		public String Summary	{ get; set; }
            
        [Required(ErrorMessage= "Please Enter a Job Description")]
        [StringLength(8000, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Job Description/ Responsibility")]
        [AllowHtml]
		public String Description	{ get; set; }

        [StringLength(1000, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Special Offer")] 
        public String SpecialOffer { get; set; }
            
        [StringLength(100, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Reference No")] 
		public String ReferenceNo	{ get; set; }
            
        [StringLength(100, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Secret Code")] 
		public String SecretCode	{ get; set; }

        [Required(ErrorMessage= "Please Select a Company")] 
        [Display(Name = "Company")] 
        public int CompanyID { get; set;}

        [Required(ErrorMessage= "Please Select a Category")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select a Category")]
        [Display(Name = "Category")] 
        public int CategoryID { get; set;}

        [Required(ErrorMessage = "Please Select a City")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select a City")]
        [Display(Name = "City")]
        public int CityID { get; set;}

        [Required(ErrorMessage= "Please Select a Employee Type")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select an Employee Type")]
        [Display(Name = "Employee Type")] 
        public int EmployeeTypeID { get; set;}
            
        [Required(ErrorMessage= "Please Enter a Post Date")]
        [Display(Name = "Post Date")]
        [DataType(DataType.Date)]
		public String PostDate	{ get; set; }
            
        [Required(ErrorMessage= "Please Enter a End Date")]
        [Display(Name = "End Date")] 
        [DataType(DataType.Date)]
		public String EndDate	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Salary Range")]        
        [Display(Name = "Salary Range from")] 
		public decimal? SalaryRangeFrom	{ get; set; }

        //[Required(ErrorMessage = "Please Enter Salary Range to")]
        [Display(Name = "Salary Range to")]
        public decimal? SalaryRangeTo { get; set; }
            
        [Required(ErrorMessage= "Please Choose Send Expire Alert?")]         
        [Display(Name = "Send Expire Alert?")] 
		public String SendExpireAlert	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Activation Key")]
        [Display(Name = "Activation Key")] 
		public String ActivationKey	{ get; set; }
            
        [Required(ErrorMessage= "Please Choose Is Active?")]         
        [Display(Name = "Is Active?/ Is Published?")] 
		public String IsActive	{ get; set; }
            
        //[Required(ErrorMessage= "Please Choose Is Deleted?")]         
        [Display(Name = "Is Deleted")] 
		public String IsDeleted	{ get; set; }
            
        [Display(Name = "Dynamic Properties")] 
		public String DynamicProperties	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Modified By")]
        [Display(Name = "Modified By")] 
		public String ModifiedBy	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Created On")]
        [Display(Name = "Created On")] 
		public String CreatedOn	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Modified On")]
        [Display(Name = "Modified On")] 
		public String ModifiedOn	{ get; set; }

        [Required(ErrorMessage = "Please Select a Country")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select a Country")]
        [Display(Name = "Country")]
        public int CountryID { get; set; }

        [Required(ErrorMessage = "Please Select a State")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select a State")]
        [Display(Name = "State")]
        public int StateID { get; set; }

        [Required(ErrorMessage = "Please Select a Job Level")]
        [Range(1, int.MaxValue, ErrorMessage = "Please Select a Job Level")]
        [Display(Name = "Job Level")]
        public int JobLevelID { get; set; }

        public ZGL.Category.Category CategoryZGL { get; set; }

        [Display(Name = "Educational Requirements")]
        //public List<EducationViewModel> Educations { get; set; }
        public String[] Educations { get; set; }

        [Display(Name="Job Requirements/Skills")]
        //public List<SkillViewModel> Skills { get; set; }
        public String[] Skills { get; set; }

        [StringLength(1000, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name="Other Education")]
        [AllowHtml]
        public String OtherEducation { get; set; }

        [StringLength(1000, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Additional Job Requirements")]
        [AllowHtml]
        public String OtherSkill { get; set; }

        public bool IsFeatured { get; set; }

        //Readonly Properties, Used only for display purpose
        public List<GenericViewModel> SelectedEducations { get { return _selectedEducations; } set { _selectedEducations = value; } }
        public List<GenericViewModel> SelectedSkills { get { return _selectedSkills; } set { _selectedSkills = value; } }
        public CompanyViewModel Company { get; set; }
        public JobLevelViewModel JobLevel { get; set; }
        public String JobLocation { get; set; }
        public JobTemplateViewModel JobTemplate { get; set; }
    }
    public class GenericViewModel
    {
        public int? ID { get; set; }
        public String Name { get; set; }
    }
}

